package com.forekonw.deomlianxi;

import java.util.Scanner;

public class Testna {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入消费金额： ");
        double money = input.nextDouble();

        if (money >= 50){

            double money1 = 0.0;

            System.out.println("是否参见换购活动");
            String choose = input.next();
            if (choose.equals("是")){
                System.out.println("1.满50元，加2元换可乐一瓶");
                System.out.println("2.满100元，加3元换500ml可乐一瓶");
                System.out.println("3.满100元，加10元换5公斤面粉");
                System.out.println("4.满200元，加10元换苏泊尔炒锅");
                System.out.println("5.满200元，加20元换电吉他");
                System.out.println("请选择： ");
                int choose1 = input.nextInt();
                switch (choose1){
                    case 1:
                        if (money>=50){
                            money1=2;
                        }
                        break;
                    case 2:
                        if (money>=100){
                            money1=3;
                        }
                        break;
                    case 3:
                        if (money>=100){
                            money1=10;
                        }
                        break;
                    case 4:
                        if (money>=200){
                            money1=10;
                        }
                        break;
                    case 5:
                        if (money>=200){
                            money1=20;
                        }
                        break;
                }
                if (choose1==1){
                    System.out.println("成功换购，可乐一瓶");
                }else if (choose1==2){
                    System.out.println("成功换购，500ml可乐");
                }else if (choose1==3){
                    System.out.println("成功换购，5公斤面粉");
                }else if (choose1==4){
                    System.out.println("成功换购，炒锅");
                }else if (choose1==5){
                    System.out.println("成功换购，电吉他");
                }
                double sal = money + money1;
                System.out.println("本次消费总金额：" + sal);



            }else {
                System.out.println("欢迎下次光临");
            }

        }else{
            System.out.println("金额未满足换购条件");
        }
    }
}
